<script setup lang="ts">
import { ref } from 'vue'
import { config, PageRouterView } from '@/components/SytPageEditor/SytPageEditor'
import { useUserStore } from '@/store/user'

config.baseUrl = 'http://localhost:8080'
config.token = useUserStore().token

const allPagesJson = ref(localStorage.getItem('SytPageEditorAllPages'))

const viewRef = ref()

const fullscreen = () => {
  viewRef.value.requestFullscreen()
}
</script>

<template>
  <div>
    <el-tag type="info" effect="dark">由低代码页面编辑器生成</el-tag>
    <el-button type="primary" size="small" @click="fullscreen">全屏</el-button>
    <div ref="viewRef">
      <PageRouterView :routes="allPagesJson"></PageRouterView>
    </div>
  </div>
</template>

<style scoped></style>
